package com.stellar.oss.core.enums;

import lombok.Getter;

/**
 * @Author Jqcc
 * @Version 1.0
 * @Data 2025/3/14
 */
@Getter
public enum OssTypeEnum {

    ALIYUN_OSS("aliyun-oss"),

    MINIO("minio"),

    TOS("tos");

    private final String type;

    OssTypeEnum(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public static OssTypeEnum fromType(String type) {
        for (OssTypeEnum ossType : values()) {
            if (ossType.getType().equalsIgnoreCase(type)) {
                return ossType;
            }
        }
        throw new IllegalArgumentException("Unsupported storage type: " + type);
    }
}
